import router from './router.config'

const menu = [
    {
        title: '交易中心',
        children: [],
        path: 'transactionCenter',
        icon: 'trademark'
    },
    {
        title: '会员中心',
        children: [],
        path: 'member',
        icon: 'team'
    },
    {
        title: '商户管理',
        children: [],
        path: 'merchant',
        icon: 'shop'
    },
    {
        title: '服务商管理',
        children: [],
        path: 'provider',
        icon: 'customer-service'
    },
    {
        title: '代理商管理',
        children: [],
        path: 'agent',
        icon: 'reconciliation'
    },
    {
        title: '省级分公司管理',
        children: [],
        path: 'province',
        icon: 'audit'
    },
    {
        title: '大区分公司管理',
        children: [],
        path: 'region',
        icon: 'flag'
    },
    {
        title: '财务中心',
        children: [],
        path: 'financial',
        icon: 'pay-circle'
    },
    {
        title: '数据中心',
        children: [],
        path: 'dataCenter',
        icon: 'cluster'
    },
    {
        title: '平台管理',
        children: [],
        path: 'platformManagement',
        icon: 'home'
    },
    {
        title: '系统设置',
        children: [],
        path: 'settings',
        icon: 'setting'
    }
]

// 匹配一级菜单下面的二级菜单
menu.map(item => {
    router.children.map(route => {
        if (route.path.includes(item.path)) {
            route.meta.rootMenu = `${item.title} / `
            item.children.push(route)
        }
    })
})
export default menu
